package org.example.script;

import org.example.HttpSend;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;

public class GenerateDailyQuestionScript {
    public static void main(String[] args) throws Exception {
        Calendar instance = Calendar.getInstance();
        instance.set(2024,3,1);
        while(instance.getTime().before(new Date())){
            instance.add(Calendar.DATE,1);
            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
            String format = simpleDateFormat.format(instance.getTime());
            HttpSend.sendHttp("http://localhost:8000/core/t-question/dailyQuestionGenerate?date="+format,
                    null,"GET",null);
            if(instance.getTime().after(new Date())){
                break;
            }
        }

    }
}
